
use crate::{
  ArenaBox,
  EntityId,
  SharedString
};

slotmap::new_key_type! {
    /// A globally unique identifier for a focusable element.
    pub struct FocusId;
}

#[derive(Clone, Debug, Eq, PartialEq, Hash)]
pub enum ElementId {
    /// The ID of a View element
    View(EntityId),
    /// An integer ID.
    Integer(usize),
    /// A string based ID.
    Name(SharedString),
    /// An ID that's equated with a focus handle.
    FocusHandle(FocusId),
    /// A combination of a name and an integer.
    NamedInteger(SharedString, usize),
}

trait ElementObject {
    fn element_id(&self) -> Option<ElementId>;

    // fn request_layout(&mut self, cx: &mut ElementContext) -> LayoutId;

    // fn paint(&mut self, cx: &mut ElementContext);

    // fn measure(
    //     &mut self,
    //     available_space: Size<AvailableSpace>,
    //     cx: &mut ElementContext,
    // ) -> Size<Pixels>;

    // fn draw(
    //     &mut self,
    //     origin: Point<Pixels>,
    //     available_space: Size<AvailableSpace>,
    //     cx: &mut ElementContext,
    // );
}

pub struct AnyElement(ArenaBox<dyn ElementObject>);